home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_10.lha
/
7_10
/
p_shuffle.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
844b
|
28 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <process.h>
include <debug.h> /* DELETE */
/ Move the top process on the run list down to its
/ proper place as ordered by time and priority
oid process::shufflerunlist()
if (debug) /*DELETE*/ cerr << "process" << this << "::shufflerunlist()\n";
for (process **pp = &t_runprocesses;
(*pp)->t_next &&
(((*pp)->t_desiredtime > (*pp)->t_next->t_desiredtime) ||
(((*pp)->t_desiredtime == (*pp)->t_next->t_desiredtime) &&
((*pp)->t_priority > (*pp)->t_next->t_priority)));
)
{
process *sv = *pp;
process *svn = sv->t_next;
*pp = svn;
sv->t_next = svn->t_next;
svn->t_next = sv;
pp = &svn->t_next;
}
if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::shufflerunlist()\n";